//服务器端
//require('path')
//客户端
//需要把require('path')，打包到bundle.js
const path = require('path')
const merge = require('webpack-merge')
const baseConfig = require('./webpack.base.js')

const clientConfig = {
  mode: 'development',
  entry: './src/client/index.js',
  output: {
    filename: 'index.js',
    path: path.resolve(__dirname, 'public')//__dirname就是服务器端的根路径，build就是需要放置的文件夹
  }
}
module.exports = merge(baseConfig, clientConfig)
/* module.exports = {
  target:'node',
  entry:'./src/index.js',
  output:{
    filename:'bundle.js',
    path:path.resolve(__dirname, 'build')
  },
  module:{
    rules:[
      {
        test:/\.js?$/,
        loader:'babel-loader',
        exclude:'/node_modules/',
        optinos:{
          presets:['react']
        }
      }
    ]
  }
} */